package newXgame.hall.object
{
	import flash.display.Sprite;
	
	import newXgame.hall.object.background.MessageBackground;
	import newXgame.utils.ExScrollUtils;
	
	import org.dstart.draw.csuper.CSprite;

	public class MessageListObject extends CSprite
	{
		private var mcBg:MessageBackground;
		private var mcScrollH:ExScrollUtils;
		
		private var sprObject:Sprite;		//	桌子列表显示层
		private var sprMask:Sprite; 		//	桌子列表遮照层
				
		public function MessageListObject()
		{
			mcBg = new MessageBackground();
			mcScrollH = new ExScrollUtils();
			sprObject = new Sprite();
			sprMask = new Sprite();
			
			sprObject.x = sprMask.x = 6;
			sprObject.y = sprMask.y = 6;
			
			mcScrollH.SetSprites(sprObject, sprMask);
			
			this._root.addChild(mcBg);
			this._root.addChild(sprObject);
			this._root.addChild(sprMask);
			this._root.addChild(mcScrollH);
		}
		
		public function ChangeSize(ww:Number, hh:Number):void
		{
			this.mcBg.ChangeSize(ww, hh);
			
			this.mcScrollH.ChangeHeight(hh - 20);
			this.mcScrollH.SetPlace(ww - 30, 5);
			
			this.sprMask.graphics.clear();
			this.sprMask.graphics.beginFill(0xFFFFFF, 1);
			this.sprMask.graphics.drawRect(0, 0, ww - 36, hh - 20);
			this.sprMask.graphics.endFill();
			
			this.mcScrollH.RushVisible();
		}		
	}
}